package TP1.implementation;

import TP1.TDA.PilaTDA;

public class PilaArrayImpl1 implements PilaTDA {
	private int cant, vec[];
	private final int MAX = 100;

	public void inicializar() {
		cant = 0;
		vec = new int[MAX];
	}

	public void apilar(int x) {
		vec[cant++] = x;
	}

	public void desapilar() {
		cant--;
	}

	public boolean vacia() {
		return (cant == 0);
	}

	public int tope() {
		return vec[cant - 1];
	}

}
